// 采购 & 损耗
import axios from '@/request.js'


export function getPurchase(page){
    
    return axios.get(`/purchase?page=${page}`);
  } 

export function createPurchase(data) {
    return axios.post("/purchase/create", data);
  }

export function updatePurchase(id,data) {
  return axios.post(`/purchase/update?id=${id}`, data);
}

export function deletePurchase(id){
  return axios.post(`/purchase/delete/id/${id}`);
}

export function mail(data){
  return axios.post(`/purchase/mail`,data);
}

export function getSpoilage(page){
    
    return axios.get(`/spoilage?page=${page}`);
  } 

export function createSpoilage(data) {
    return axios.post("/spoilage/create", data);
  }

export function updateSpoilage(id,data) {
  return axios.post(`/spoilage/update?id=${id}`, data);
}

export function deleteSpoilage(id){
  return axios.post(`/spoilage/delete/id/${id}`);
}

//採購簽收
export function signfor(id,data){
  return axios.post(`/purchase/signfor/id/${id}`,data);
 
}